﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cofe.Core
{
    [Flags]
    public enum CacheUpdateOptions : int
    {
        /// <summary>
        /// Entries are updated manually calling DatabaseProperties.WriteAsync().
        /// </summary>
        [EditorBrowsable(EditorBrowsableState.Never)]
        manualUpdate = 1 << 0,

        /// <summary>
        /// Entries are updated when parsed or listed.
        /// </summary>
        [EditorBrowsable(EditorBrowsableState.Never)]
        passiveUpdate = 1 << 1,

        /// <summary>
        /// Create a new thread and look for expired entry when COFE services is imported.        
        /// </summary>
        [EditorBrowsable(EditorBrowsableState.Never)]
        activeUpdate = 1 << 2,
        
        /// <summary>
        /// For Passive or ProactiveUpdate, update an entry only if the entry is expired.
        /// </summary>
        [EditorBrowsable(EditorBrowsableState.Never)]
        updateIfEntryExpired = 1 << 3,

        /// <summary>
        /// For Passive or ProactiveUpdate, update listing only if the entry's listing is expired.
        /// </summary>
        [EditorBrowsable(EditorBrowsableState.Never)]
        updateIfListExpired = 1 << 4,

        Manual = manualUpdate | updateIfEntryExpired,
        Active = activeUpdate | passiveUpdate | updateIfEntryExpired | updateIfListExpired,
        Passive = passiveUpdate | updateIfEntryExpired | updateIfListExpired
    }
}
